1. Field of Invention
The present invention pertains to the field of distributed systems. More particularly, this invention relates to organization of time synchronization in a distributed system.
2. Art Background
Distributed control systems are commonly arranged as a collection of nodes which are interconnected via one or more network communication links. These network communication links may be packetized links such as Ethernet or one or more of a variety of other packetized links, that are adapted to distributed control system applications.
Distributed control systems commonly benefit from precise control of the timing at the distributed nodes. U.S. Pat. No. 5,566,180 of Eidson et. al. teaches a method and apparatus for providing precise control of timing in distributed nodes by synchronizing the local clocks in the distributed nodes. The techniques taught by Eidson et al use a master clock/slave clock synchronization protocol. It would be desirable to provide a technique that allows the distributed nodes to automatically select which are the master nodes and which are the slave nodes at startup and as new nodes are installed or removed or temporarily disabled. This would reduce the administrative overhead needed to maintain the distributed system. It is also desirable that such automatic selection of master and slave nodes minimally impact the communication in the distributed system.
A distributed system is disclosed with mechanisms for automatic selection of the master and slave clocks used for clock synchronization. The distributed system includes a set of nodes, including a first node and a second node, each having a local clock and a set of information pertaining to the local clock. The first node transfers a packet on a communication link that carries the information pertaining to the local clock in the first node. The second node receives the packet on the communication link and determines whether the local clock in the second node is to be a master clock that synchronizes a time value in the local clock of the first node or a slave clock that synchronizes to a time value from the local clock in the first node. The second node makes this determination by comparing the information in the packet to the information pertaining to the local clock in the second node.
Also disclosed is automatic selection of master and slave clocks in boundary nodes that couple together different subnets of nodes. In addition, mechanisms for determining clock synchronization delays and mechanisms for reporting jitter associated with communication devices are disclosed.
The present techniques enable a set of substantially similar code to execute in each of the nodes with some modification for boundary nodes which are slightly different due to their multi-sided structure. These techniques also, provide for minimal network traffic and tolerate and correct for the appearance or disappearance of individual nodes in the system.
Other features and advantages of the present invention will be apparent from the detailed description that follows.